package com.yfqy.app.modules.address.dto;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Size;
import lombok.Data;

@Data
public class DeliveryAddressDTO {

    @NotBlank(message = "收货人姓名不能为空")
    @Size(max = 20, message = "收货人姓名长度不能超过20个字符")
    private String receiverName;

    @NotBlank(message = "收货人电话不能为空")
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号格式不正确")
    private String receiverPhone;

    @NotNull(message = "省份不能为空")
    private Integer provinceId;

    @NotNull(message = "城市不能为空")
    private Integer cityId;

    @NotNull(message = "区县不能为空")
    private Integer districtId;

    @NotBlank(message = "详细地址不能为空")
    @Size(max = 255, message = "详细地址长度不能超过255个字符")
    private String receiverAddress;

    @Size(max = 20, message = "邮政编码长度不能超过20个字符")
    private String postCode;

    @NotNull(message = "区县级地址Id不能为空")
    private Integer areaId;

    private Boolean isDefault;

    @Size(max = 20, message = "地址标签长度不能超过20个字符")
    private String addressTag;
}